/**
 * @date: 2024-10-10 18:07:29
 * @description: 路由守卫（权限判断）
 * @modifyContent:
 * @author: Forever丿顾北
**/
import { Navigate } from "react-router-dom";

const RouterAuth = ({ children }) => {
  const token = localStorage.getItem('token');
  if (!token) {
    return <Navigate to="/login" replace />;
  }
  return <>{children}</>; // 使用 JSX 包装 children
};

export default RouterAuth;